package com.ygqh.baby.utils;

import java.util.Comparator;

import com.ygqh.baby.model.YgShoppingCarModel;

public class CarComparator implements Comparator<Object> {

	@Override
	public int compare(Object o1, Object o2) {
		YgShoppingCarModel car1 = (YgShoppingCarModel) o1;
		YgShoppingCarModel car2 = (YgShoppingCarModel) o2;
		if (car1.getSalesPrice().compareTo(car2.getSalesPrice()) > 0)
			return -1;
		else if (car1.getSalesPrice().compareTo(car2.getSalesPrice()) == 0)
			return 0;
		else
			return 1;
	}

}
